        $('form').submit(function(){
            alert("3");
            var name = $('#member_name').val();
            var pic = $('#pic').val();
            alert("2");
            var sort = $("#sort").val();
            alert("1");
            if(name == ''){
                alert('xx');
                //layer.msg('请填写员工姓名',{time:1000});
                return false;
            }
            if(pic == ''){
                layer.msg('请上传图片',{time:1000});
                return false;
            }
            if(!sort || isNaN(sort)){
                layer.msg('请填写排序，并且为数字',{time:1000});
                return false;
            }
        });
                    //获取跳转路径也就是action的值。
            var url = $(this).attr('action');
            var fd = new FormData();
            fd->append('name',name);
            fd->append('pic',pic);
            fd->append('sort',sort);
            $.ajax({
                type:"post",
                url :url,
                data:fd,
                success: function(res){
                    if (res.status) {
                        layer.msg(res.message,{time:1000},function(){
                            window.location.href = "{:U('lists')}";
                        });
                    }else{
                        layer.msg(res.message,{time:1000},function(){
                            window.location.href = "{:U('add')}";
                        });
                    }                
                }
            });
            return false;